﻿@model SiteConfigViewModel
<div class="layui-row layui-col-space15">
	<div class="layui-col-md12">
		<div class="layui-card">
			<div class="layui-card-header">上传设置</div>
			<div class="layui-card-body" pad15>

				<form asp-controller="SiteConfig" asp-action="UpLoadFilesConfig" class="layui-form" wid100 lay-filter="">
					<div class="layui-form-item">
						<label class="layui-form-label">允许上传文件</label>
						<div class="layui-input-block">
							<input type="checkbox" asp-for="UploadFilesConfigEntity.EnableUploadFiles" lay-skin="switch" lay-text="已开启|已关闭">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">允许的文件大小</label>
						<div class="layui-input-inline" style="width:100px;">
							<input type="text" class="layui-input" asp-for="UploadFilesConfigEntity.UploadFileMaxSize">
						</div>
						<div class="layui-form-mid layui-word-aux">KB</div>
						<div class="layui-form-mid layui-word-aux">
							<span asp-validation-for="UploadFilesConfigEntity.UploadFileMaxSize" style="color:red;"></span>
							说明：1 KB = 1024 Byte，1 MB = 1024 KB
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">网站上传目录</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" asp-for="UploadFilesConfigEntity.UploadDir" placeholder="例：UploadFiles">
							<span asp-validation-for="UploadFilesConfigEntity.UploadDir" style="color:red;"></span>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">目录保存规则</label>
						<div class="layui-input-block">
							<select asp-for="UploadFilesConfigEntity.UploadFilePathRule">
								<option value="{$RootDir}/{$Year}/{$Month}">{$RootDir}/{$Year}/{$Month}</option>
								<option value="{$NodeDir}/{$Year}/{$Month}">{$NodeDir}/{$Year}/{$Month}</option>
								<option value="{$ParentDir}/{$Year}/{$Month}">{$ParentDir}/{$Year}/{$Month}</option>
								<option value="{$FileType}/{$Year}/{$Month}">{$FileType}/{$Year}/{$Month}</option>
							</select>
							<span class="layui-bg-green">
								说明：{$RootDir}：一级栏目目录、{$NodeDir}：当前栏目目录、{$ParentDir}：当前栏目的父目录、{$Year}：年、{$Month}：月、{$Day}：日、{$FileType}：文件类型
							</span>
							<span asp-validation-for="UploadFilesConfigEntity.UploadFilePathRule" style="color:red;"></span>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">文件名保存规则</label>
						<div class="layui-input-block">
							<select asp-for="UploadFilesConfigEntity.UploadFileName">
								<option value="{$Year}{$Month}{$Day}{$Hour}{$Minute}{$Second}">{$Year}{$Month}{$Day}{$Hour}{$Minute}{$Second}</option>
								<option value="{$Random}">{$Random}</option>
								<option value="{$Origin}">{$Origin}</option>
							</select>
							<span class="layui-bg-green">
								说明：{$Origin}：原文件名、{$Random}：随机数、{$Year}：年、{$Month}：月、{$Day}：日、{$Hour}：时、{$Minute}：分、{$Second}：秒
							</span>
							<span asp-validation-for="UploadFilesConfigEntity.UploadFileName" style="color:red;"></span>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">允许上传后缀名</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" asp-for="UploadFilesConfigEntity.UploadFileExts" placeholder="例：gif,jpg,jpeg,jpe,bmp,png,rar,zip,xls,xlsx,doc,docx,ppt,pptx,txt">
							<span asp-validation-for="UploadFilesConfigEntity.UploadFileExts" style="color:red;"></span>
						</div>
					</div>
					<div class="layui-form-item">
						<div class="layui-input-block">
							<button class="layui-btn" lay-submit lay-filter="">确认保存</button>
							<span style="color:red; font-size:18px;">@Html.ValidationSummary(true)</span>
						</div>
					</div>
				</form>

			</div>
		</div>
	</div>
</div>
